<?php


namespace app\utils;


class PasswordConvert
{
    private $key;
    private $method;
    private $options;

    public function __construct()
    {
        $this->key = env('convert.name');
        $this->method = env('convert.method' , 'DES-ECB');
        $this->options = 0;
    }

    public function encryption($password){
        return openssl_encrypt($password , $this->method , $this->key , $this->options);
    }

    public function decrypt($password){
        return openssl_decrypt($password , $this->method , $this->key , $this->options);
    }
}